***Table 5

*raw data not included
*Instead of providing proprietary data, we provide a log file. 

****************report level measure
***report 
cd ""

import delimited "report_measures.csv",clear

*#report with culture
sum gvkey 
unique gvkey year 
unique gvkey 

*
sum gvkey if top_cause_type!=""
sum gvkey if top_consequence_type!=""
unique gvkey year if top_cause_type!=""
unique gvkey year  if top_consequence_type!=""
unique gvkey  if top_cause_type!=""
unique gvkey  if top_consequence_type!=""
*either or 
sum gvkey if top_cause_type!="" | top_consequence_type!=""
unique gvkey year if top_cause_type!="" | top_consequence_type!=""
unique gvkey  if top_cause_type!="" | top_consequence_type!=""

*with cause only 
sum gvkey if top_cause_type!="" & top_consequence_type==""

*both 
sum gvkey if top_cause_type!="" & top_consequence_type!=""
unique gvkey year if top_cause_type!="" & top_consequence_type!=""
unique gvkey  if top_cause_type!="" & top_consequence_type!=""







***calls
import delimited "component_measures.csv",clear
unique gvkey date
gen year=substr(date,1,4)
 unique gvkey year
  
unique gvkey date if top_cause_type!=""
unique gvkey date  if top_consequence_type!=""
unique gvkey year if top_cause_type!=""
unique gvkey  year if top_consequence_type!=""
unique gvkey  if top_cause_type!=""
unique gvkey  if top_consequence_type!=""

*either or 
unique gvkey date if top_cause_type!="" | top_consequence_type!=""
unique gvkey year if top_cause_type!="" | top_consequence_type!=""
unique gvkey  if top_cause_type!="" | top_consequence_type!=""

*with cause only 
sum gvkey if top_cause_type!="" & top_consequence_type==""

*both 
unique gvkey date if top_cause_type!="" & top_consequence_type!=""
unique gvkey year if top_cause_type!="" & top_consequence_type!=""
unique gvkey  if top_cause_type!="" & top_consequence_type!=""


***review 
import delimited "review_measures.csv",clear
unique review_id
**# Bookmark #6
unique gvkey 
gen year=substr(date,1,4)
tab year 
destring year,replace 
*keep in line with report sample
drop if year>2020

 unique gvkey year
 unique gvkey 
 
 sum gvkey if top_cause_type!=""
  sum gvkey if top_consequence_type!=""
unique gvkey year if top_cause_type!=""
unique gvkey year  if top_consequence_type!=""
unique gvkey  if top_cause_type!=""
unique gvkey  if top_consequence_type!=""


*either or 
sum gvkey if top_cause_type!="" | top_consequence_type!=""
unique gvkey year if top_cause_type!="" | top_consequence_type!=""
unique gvkey  if top_cause_type!="" | top_consequence_type!=""

*with cause only 
sum gvkey if top_cause_type!="" & top_consequence_type==""

*both 
sum gvkey if top_cause_type!="" & top_consequence_type!=""
unique gvkey year if top_cause_type!="" & top_consequence_type!=""
unique gvkey  if top_cause_type!="" & top_consequence_type!=""


***
